﻿function load_record(begin_time, end_time) {
    $("table#qj_table tr:gt(0)").remove();
    $.ajax({
        url: "Ajax/QueryRecord.aspx?type=qj",
        type: "post",
        dataType: "json",
        data: { begin: begin_time, end: end_time },
        success: function (msg) {
            $(msg).each(function () {
                var td_empname = "<td style='width:80px'>" + this.emp_name + "</td>";
                var td_department = "<td style='width:100px'>" + this.department + "</td>";
                var td_endtime = "<td style='width:160px'>" + this.end_time + "</td>";
                var td_begintime = "<td style='width:160px'>" + this.end_time + "</td>";
                var td_reason = "<td style='width:200px;text-align:left'>" + this.reason + "</td>";
                var row = "<tr class='record_row'>" + td_empname
                + td_department + td_begintime + td_endtime + td_reason + "</tr>";
                var row_count = $("table#qj_table").size();
                row_count = row_count - 1;
                $(row).insertAfter($("table#qj_table tr:eq(" + row_count + ")"));
            })
        }
    })
}
$("document").ready(function () {
    load_record("2012-04-01 00:00:00", "2012-06-01 00:00:00");
})